Skip to content

feat(maintain): extract-helper scope (v8) — parameterized dedup with zero call-site risk#99

Merged
QodeXcli merged 1 commit into
mainfrom
feat/maintain-extract-helper
Jul 2, 2026
Merged

feat(maintain): extract-helper scope (v8) — parameterized dedup with zero call-site risk#99
QodeXcli merged 1 commit into
mainfrom
feat/maintain-extract-helper

Conversation

@QodeXcli

@QodeXcli QodeXcli commented Jul 2, 2026

Copy link
Copy Markdown
Owner

P1b concluded: the near-dupe pipeline (find_similar_helpers #91 + parameterize proposals #95) becomes an unattended maintain scope — in the only shape safe enough for a nightly run.

The safety design

Consolidating near-dupes normally means touching call sites — too risky unattended. v8 sidesteps that entirely:

  • Only clusters with a mechanical parameterize proposal qualify (bodies align token-for-token, ≤4 varying spots). No proposal → BLOCK — "manual judgment isn't a nightly job."
  • The originals become one-line delegating wrappers over the new shared helper, using the proposal's exact argument mapping. Signatures, exports, and every call site stay byte-for-byte compatible.
  • Skips tests/generated code and clusters with dropped (structurally different) members.
  • Verified-PR gated: tests + types green or nothing ships.

Where v7 consolidate-dupes repoints callers (needs the full reference proof), v8 needs no caller knowledge at all — the wrapper preserves the public surface. Different risk profile, complementary scopes.

  • Parse aliases: extract-helper / helpers / parameterize (+ --dry-run as usual)
  • Auto-surfaces in stats/next-scope recommendation, the demo scope picker (with its own receipt example), and docs/MAINTAIN.md (v8 row)
  • +1 scope test (aliases, wrapper mandate, mechanical-or-block gate, receipt); scope-list assertions updated

Full suite 1525 green, tsc clean.

…ZERO call-site risk

The near-dupe detection (find_similar_helpers) + parameterize proposal (v2) become an unattended
maintain scope — in the only shape safe enough for 3am:

- Pick ONE cluster that comes back WITH a mechanical parameterize proposal (bodies align
  token-for-token, ≤4 varying spots). No proposal → BLOCK — manual judgment isn't a nightly job.
- Create the shared parameterized helper, then rewrite each original as a ONE-LINE delegating
  wrapper using the proposal's argument mapping. Signatures, exports, and every call site stay
  byte-for-byte compatible — the zero-caller-risk form of deduplication (unlike consolidate-dupes,
  which repoints callers and needs the full reference proof).
- Skips clusters touching tests/generated code or with `dropped` (structurally different) members.
- Ships through the shared verified-PR protocol: tests + types green or nothing lands.

Parse aliases: extract-helper | helpers | parameterize. Demo scope card, docs/MAINTAIN.md v8 row,
scope-list + prompt tests updated.
@QodeXcli QodeXcli merged commit dceec00 into main Jul 2, 2026
2 checks passed
@QodeXcli QodeXcli deleted the feat/maintain-extract-helper branch July 2, 2026 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant